jQuery(document).ready(function(){
    checkCustomize = function () {
        //业务类型
        var ywlxFieldid = WfForm.convertFieldNameToId("ywlx");
        var ywlxValue = WfForm.getFieldValue(ywlxFieldid);
        //供应商名称
        var gysmcFieldid = WfForm.convertFieldNameToId("gysmc");
        var gysmcValue = WfForm.getFieldValue(gysmcFieldid);
        if (ywlxValue == "0") {//当业务类型为新增时进行提交校验
            jQuery.ajax({
                url: "/api/weavernorth/supplier/checkSupplier",
                async: false,
                contentType:"application/x-www-form-urlencoded; charset=UTF-8",
                type:"get",
                data:{"gysmc":gysmcValue},
                success: function (data) {
                    if(data=='0'){
                        alert("该供应商名称已存在！");
                        return false;
                    }else{
                        return true;
                    }
                },
                error: function () {  //请求失败时被调用的函数
                    alert("加载失败，请联系管理员！");
                    return false;
                }
            });
        }else{
            return true;
        }
    }
});